package org.acme.oauth2.resource;

import io.quarkus.qute.Template;
import io.quarkus.qute.TemplateInstance;
import org.acme.oauth2.client.TdfOauth2Client;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * @author LiJian
 * @date 2021/7/13 14:25
 */
@Path("/login")
public class TdfOauth2ClientLoginResource {
    private static final Logger LOGGER = LoggerFactory.getLogger(TdfOauth2ClientLoginResource.class);

    @Inject
    @RestClient
    TdfOauth2Client tdfOauth2Client;

    @Inject
    Template login;

    @Path("author")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public TemplateInstance getAccess() {
        return login.data("clientId","yes");
    }
    @Path("token")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public TemplateInstance getToken() {

        return login.data("clientId","yes");
    }
    @Path("user")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public TemplateInstance getUser() {
        //获取token
        //Map集合设置请求参数
        return login.data("clientId","yes");
    }
}
